<?php
/**
 * Created by IntelliJ IDEA.
 * User: sun
 * Date: 2017/6/22
 * Time: 上午9:46
 */

namespace app\base;

use think\Controller;
use app\base\Logger;
class Main extends Controller
{
    private $jx;

    public function _initialize(){
        parent::_initialize();
    }

    public function jx(){
        if (!$this->jx){
            $this->jx = lib('jx','lib');
        }
        return $this->jx;
    }

    public function resp($data = '', $code = 0, $msg = ''){
        if (is_array($data)){
            $data = array_map('changeToString',$data);
        }
        $code = (string)$code;
        parent::result($data,$code,$msg,'json');
    }

    public function wrong($code){
        $this->resp('',$code,'error');
        /*
        -1 验签错误

         */
    }
}